/*******************************************************************************
Project:        Rents
Last modified:  2024-03-06
Description:    This file creates figures displaying point estimates and confidence intervals for the Suits and Kakwani indices in selected specifications. 
*******************************************************************************/

clear all

global home "V:\sthorpe\Rents"
global output "$home\figures"

global gpr = "plotregion(fcolor(white) lcolor(white) m(tiny)) graphregion(fcolor(white) lcolor(white))"

cd "$home"


import excel "kakwani_suits_est_cis.xlsx", firstrow clear


g kak_index_100 = 100 + (pe_kak - .16126062)*100 / .16126062
g suits_index_100 = 100 + (pe_suits - .27570238)*100 / .27570238

g se_kak_index = e_kak * 100 / .16126062
g se_suits_index = e_suits * 100 / .27570238

matrix input Kakwani = (100, 102.3187, -32.49701, 59.54903, 78.30045, 108.6866 \ 2.059784, .9776554,  2.024923, 1.239657, 1.076111, .9225132)

matrix input Suits = (100, 83.5779, -3.625599, 54.2691, 64.47701, 102.0992 \ 3.006804, 1.468437, 2.293978, 1.705038, 1.590367, 1.289452)

coefplot mat(Kakwani) mat(Suits) `gpr', xsize(10) yscale(range(-35 135)) ylabel(-25(25)125) ciopts(recast(rcap)) se(2) vertical yline(100, lcolor(cranberry) lp(solid)) xlab(none) ylab(-25(25)125) ytitle("Suits/Kakwani Index, Rescaled: Base Case = 100") p1(mcolor(dknavy) msymbol(diamond) ciopts(lcolor(dknavy)) recast(rcap)) p2(mcolor(maroon) msymbol(square) ciopts(lcolor(maroon)) recast(rcap))

graph export "$output/dual_cis_A.png", replace

clear matrix

matrix input Kakwani = (100, 101.3925, 103.7047, 58.53672, 87.65887, 132.0644 \ 2.059784, 1.39608, .4906792, .864035, .9153805, 1.202283)

matrix input Suits = (100,  90.13747, 73.7616, 53.04988, 73.31445, 104.6437 \ 3.006804,  2.102148, .5729742, 1.115427, 1.306472, 2.015468)


coefplot mat(Kakwani) mat(Suits) `gpr', xsize(10) yscale(range(-35 135)) ylabel(-25(25)125) se(2) vertical yline(100, lcolor(cranberry) lp(solid)) xlab(none) ylab(-25(25)125) ytitle("Suits/Kakwani Index, Rescaled: Base Case = 100") p1(mcolor(dknavy) msymbol(diamond) ciopts(lcolor(dknavy)) recast(rcap)) p2(mcolor(maroon) msymbol(square) ciopts(lcolor(maroon)) recast(rcap))
graph export "$output/dual_cis_B.png", replace


end



